const express = require('express')
const logger = require('express-simple-logger')

const app = express()
app.use(logger())

app.get("/baseurl", async (req, res)=>{
    res.send("<h1>Node Express</h1>")
});

app.get("/baseurl/path1", async (req, res)=>{
    res.redirect("/baseurl/path3");
});

app.get("/baseurl/path2", async (req, res)=>{
    res.send("<h1>Node Express Path2</h1>")
});

app.get("/baseurl/path3", async (req, res)=>{
    res.send("<h1>Node Express Path3</h1>")
});

app.listen(8882, () => {
    console.log('应用已经启动，http://localhost:8882');
});